package com.norbitltd.guavaleaves.java.util;

import java.util.Collection;

import com.google.common.base.Predicate;
import com.norbitltd.guavaleaves.java.lang.ObjectPredicates;

public class CollectionPredicates extends ObjectPredicates {
	
	public <T> Predicate<Collection<T>> isEmpty() {
		return new Predicate<Collection<T>>() {
			public boolean apply(Collection<T> input) {
				return input.isEmpty();
			}
		};
	}
	
	public <T> Predicate<Collection<T>> contains(final T element) {
		return new Predicate<Collection<T>>() {
			public boolean apply(Collection<T> input) {
				return input.contains(element);
			}
		};
	}
	
	public <T> Predicate<Collection<T>> containsAll(final Collection<T> elements) {
		return new Predicate<Collection<T>>() {
			public boolean apply(Collection<T> input) {
				return input.containsAll(elements);
			}
		};
	}
}
